package com.atguigu.dw.gmall.realtime.bean

/**
 * description ：订单表
 * author      ：剧情再美终是戏 
 * mail        : 13286520398@163.com
 * date        ：Created in 2020/2/14 18:43
 * modified By ：
 * version:    : 1.0
 */
case class OrderInfo(id: String,
                     province_id: String,
                     var consignee: String,
                     order_comment: String,
                     var consignee_tel: String,
                     order_status: String,
                     payment_way: String,
                     user_id: String,
                     img_url: String,
                     total_amount: Double,
                     expire_time: String,
                     delivery_address: String,
                     create_time: String, // 2020-02-13 06:14:50
                     operate_time: String,
                     tracking_no: String,
                     parent_order_id: String,
                     out_trade_no: String,
                     trade_body: String,
                     var create_date: String = null,
                     var create_hour: String = null) {
  // 时间处理
  create_date = create_time.substring(0, 10)
  create_hour = create_time.substring(11, 13)

  // 电话和姓名脱敏
  consignee = consignee.substring(0, 1) + "**"
  consignee_tel = consignee_tel.replaceAll("(\\d{3})(\\d{4})(\\d{4})", "$1****$3")
}

